"""

"""
import pytest
import time
import logging


@pytest.fixture(scope='session', autouse=True)
def run_times():
    # 开始时间 :
    start_time = time.time()
    logging.info('开始时间 : ' + str(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())))
    yield
    # 结束时间 :
    end_time = time.time()
    time_s = end_time - start_time
    logging.info('结束时间 : ' + str(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())))
    logging.info('共计耗时 : ' + str(time_s))


def pytest_collection_modifyitems(items):
    # 编码
    for item in items:
        item.name = item.name.encode("utf-8").decode("unicode_escape")
        item._nodeid = item.nodeid.encode("utf-8").decode("unicode_escape")
